package com.ycMc.mapper;

import com.ycMc.domain.Product;
import com.ycMc.domain.ProductBrand;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Created by libo2 on 2017/8/17.
 */
@Repository
public interface ProductMapper {

    public void insert(Product product);
    public void delete(@Param("productId")String productId);
    public void update(Product product);
    public List<Product> select(
                                 @Param("productId")String productId,
                                 @Param("productBrand")String productBrand,
                                 @Param("productName")String productName,
                                 @Param("productVersion")String productVersion,
                                 @Param("singlePrice")double singlePrice,
                                 @Param("store")int store,
                                 @Param("tradeCnt")int tradeCnt,
                                 @Param("offset")int offset,
                                 @Param("pageSize")int pageSize,
                                 @Param("containZero")int containZero);
    public Product selectOne(@Param("productId")String productId);

    public List<Product> query(
            @Param("keyword")String keyword,
            @Param("offset")int offset,
            @Param("pageSize")int pageSize,
            @Param("containZero")int containZero);

    public void updateSubtractionStore(@Param("productId")String productId,@Param("store")int store);

}
